﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HuiGuanTF_DR.aspx.cs" Inherits="Web.Pages.QuShui.DiXiaS.ShouFeiGL.HuiGuanTF_DR" Theme="Default"%>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>回灌退费</title>
    <script src="../../../../JS/jquery.js" type="text/javascript"></script>
    <script src="../../../../JS/AddEditCancel.js" type="text/javascript"></script>
   <%-- <link href="../../../../css/inputBgColor.css" rel="stylesheet" />--%>
    <style type="text/css">
        body, html {
            padding: 0;
            margin: 0;
            font-size: 12px;
        }

        #img table tr td div {
            cursor: pointer;
        }
    </style>
    <script type="text/javascript">
        

        function DeleteData() {
            var bh = gvList.GetRowKey(gvList.GetFocusedRowIndex());
            if (bh != '') {
                if (confirm('确定要删除该年月的上传数据吗？')) {
                    hdCollection.Set("bh", bh);

                    ASPxCallback1.PerformCallback("delete");
                }
            }
            else {
                alert('请先选择要删除的记录');
            }
        }

        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            if (type == "delete") {
                if (arr[2] == '1') {
                    alert('保存成功！');
                    gvList.PerformCallback();
                }
            }
        }
        
        ///////////////////////////////////////////////////////////////////////////////////////////
        function Uploader_OnFileUploadComplete(args) {           
            alert(args.callbackData);    
            gvList.PerformCallback();
        }

        function Uploader_OnFileUploadStart(e) {
            //alert(cmbYear.GetText());
            hdCollection.Set("year", cmbYear.GetText());
            hdCollection.Set("month", cmbMonth.GetText());
        }

        function rowClick() {
            if (gvList.GetFocusedRowIndex() != -1) {
                if (gvList.GetFocusedRowIndex() != -1) {
                    hdCollection.Set("I_BIANHAO", gvList.GetRowKey(gvList.GetFocusedRowIndex()));
                    //alert(gvList.GetRowKey(gvList.GetFocusedRowIndex()));
                    gvList2.PerformCallback();
                }
            }
        }

        function OpenUrl() {
            var year = cmbYear.GetText();
            var month = cmbMonth.GetText();
            var url = '\\UpLoad\\HGTF_DXS\\' + year + '年' + month + '月地下水人工回灌预退费汇总表.xlsx';
            window.open(url);
        }
        
    </script>
</head>
<body style="scroll:none">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            回灌退费
        </div>
        <div style="display: none;">
            
            <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
            <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
         <dx:ASPxLoadingPanel ID="ASPxLoadingPanel1" ClientInstanceName="loadpanel1" runat="server" ContainerElementID="gvList" Modal="true" Theme="Metropolis" ShowImage="false" Text="加载中" ></dx:ASPxLoadingPanel> 
        </div>

        <asp:UpdatePanel ID="updatePanel1" runat="server">
            <ContentTemplate>
                <div style="width:100%;">
                    <div>
                         <table style=" height: 35px">
                             <tr>
                                 <td align="right" style="min-width: 10px">年：</td>
                                 <td style="width: 100px">
                                     <asp:Panel runat="server" ID="Panel7">
                                         <dx:ASPxComboBox runat="server" ID="cmbYear" Width="90%" ClientInstanceName="cmbYear">
                                         </dx:ASPxComboBox>
                                     </asp:Panel>
                                 </td>
                                 <td align="right" style="min-width: 10px">月：</td>
                                 <td style="width: 100px">
                                     <asp:Panel runat="server" ID="Panel71">
                                         <dx:ASPxComboBox runat="server" ID="cmbMonth" Width="90%" ClientInstanceName="cmbMonth">
                                         </dx:ASPxComboBox>
                                     </asp:Panel>
                                 </td>
                                 <td style="width: 80px;">
                                     <dx:ASPxButton runat="server" Visible="false" ID="btnImportExceltab7" Text="导入Excel" >
                                     </dx:ASPxButton>
                                     <dx:ASPxUploadControl ID="UpLoadFile" runat="server" ClientInstanceName="uploader"
                                         ShowTextBox="false" Theme="Aqua" UploadMode="Standard" ShowClearFileSelectionButton="False"
                                         ShowProgressPanel="false" NullText="" OnFileUploadComplete="UpLoadFile_FileUploadComplete"
                                         Width="0px">
                                         <BrowseButton Text="导入Excel"></BrowseButton>
                                         <ClientSideEvents FileUploadComplete="function(s, e) { Uploader_OnFileUploadComplete(e); }"
                                             TextChanged="function(s, e) { uploader.Upload();}"
                                              FilesUploadStart="function(s,e){Uploader_OnFileUploadStart(e);}"></ClientSideEvents>
                                         <ValidationSettings MaxFileSize="4194304" AllowedFileExtensions=".xls,.xlsx">
                                         </ValidationSettings>
                                     </dx:ASPxUploadControl>
                                 </td>
                                 <td style="width:5px">&nbsp;
                                 </td>
                                  <td>
                                     <dx:ASPxButton ID="btnDrop" runat="server" Text="删除"  UseSubmitBehavior="false" AutoPostBack="false">
                                         <ClientSideEvents  Click="function(s,e){DeleteData();}"/>
                                     </dx:ASPxButton>
                                     
                                 </td> 
                                 <td style="width:5px">&nbsp;
                                 </td>
                                 <td>
                                     <dx:ASPxButton ID="btnExport" runat="server" Text="下载"  UseSubmitBehavior="false" AutoPostBack="false">
                                         <ClientSideEvents  Click="function(s,e){OpenUrl();}"/>
                                     </dx:ASPxButton>
                                 </td>

                             </tr>
                    </table>
                    </div>
                   

                    <%--<div style="border: 1px solid #d0e4fe;">
                        <div id="img">
                            <table style="width:100%;">
                                <tr>
                                    <td style="width:50%;text-align:left;">
                                          <dx:ASPxButton ID="btnsx" Text="刷新" runat="server" OnClick="btnsx_Click" ></dx:ASPxButton> 
                                    </td>
                                    <td style="width:50%;text-align:right">
                                        <dx:ASPxLabel ID="zjl" Text="共0条" runat="server" ForeColor="Blue"></dx:ASPxLabel>
                                    </td>
                                </tr>
                            </table>
                        </div>--%>
                    <div id="divList">
                        <div style="float: left;width:29%;">
                            <dx:ASPxGridView ID="gvList" SettingsBehavior-AllowSort="true" ClientInstanceName="gvList" runat="server" AutoGenerateColumns="False" KeyFieldName="I_BIANHAO"
                                ClientIDMode="AutoID" Width="100%" OnCustomCallback="gvList_CustomCallback">
                                <Columns>
                                    <dx:GridViewDataTextColumn FieldName="I_YM" Caption="年月" Width="15%" HeaderStyle-HorizontalAlign="Left">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="S_WJM" Caption="文件名" Width="85%" HeaderStyle-HorizontalAlign="Left">
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                                <Settings VerticalScrollBarMode="Visible" HorizontalScrollBarMode="Auto" VerticalScrollableHeight="400 " />
                                <SettingsPager Mode="EndlessPaging" PageSize="100" />
                                <Settings ShowFooter="True" />
                                <SettingsBehavior AllowFocusedRow="True"  ColumnResizeMode="Control" />
                                 <ClientSideEvents FocusedRowChanged="function(s,e){rowClick();}" />
                                <SettingsBehavior ProcessFocusedRowChangedOnServer="False" />
                                
                            </dx:ASPxGridView>
                        </div>
                         <div style="float: right;width:69%;">
                            <dx:ASPxGridView ID="gvList2" SettingsBehavior-AllowSort="true" ClientInstanceName="gvList2" runat="server" AutoGenerateColumns="False" KeyFieldName="ID"
                                ClientIDMode="AutoID" Width="100%" OnCustomCallback="gvList2_CustomCallback">
                                <Columns>
                                   <dx:GridViewDataTextColumn FieldName="S_HUMING" Caption="户名" Width="200" >
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="I_ZBYTSL" Caption="至本月退水量" Width="90" >
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="I_YTSL" Caption="已退水量" Width="70" >
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="I_BCTFSL" Caption="本次退费水量" Width="90" >
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="N_SJ" Caption="水价" Width="60"  PropertiesTextEdit-DisplayFormatString="0.00">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="N_BCTSF" Caption="本次退水费" Width="85" PropertiesTextEdit-DisplayFormatString="0.00">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="N_YTSF" Caption="预退水费" Width="70" PropertiesTextEdit-DisplayFormatString="0.00">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="N_STSF" Caption="实退水费" Width="70" PropertiesTextEdit-DisplayFormatString="0.00">
                                    </dx:GridViewDataTextColumn>
                                </Columns>
                                <Settings VerticalScrollBarMode="Visible" HorizontalScrollBarMode="Auto" VerticalScrollableHeight="400 " />
                                <SettingsPager Mode="EndlessPaging" PageSize="100" />
                                <Settings ShowFooter="True" />
                                <SettingsBehavior AllowFocusedRow="True"  ColumnResizeMode="Control" />
                                <SettingsBehavior ProcessFocusedRowChangedOnServer="False" />
                               
                            </dx:ASPxGridView>
                        </div> 
                    </div>

                        <div>
                            
                        </div>
                        <%--  <div style="text-align: right">
                        <hr />
                        <dx:ASPxButton ID="btnAdd" ClientInstanceName="btnAdd" runat="server" Text="添加" AutoPostBack="false"  ClientSideEvents-Click="function(s,e){display('add',-1)}"  UseSubmitBehavior="false">
                        </dx:ASPxButton>
                    </div> 
                        <div id="GridViewContentTable" style="display: none;">
                            <div class="tabletitle1" align="center">
                                <dx:ASPxLabel ID="lblOperateTip" runat="server" ClientInstanceName="lblOperateTip" Text="添加"></dx:ASPxLabel>
                            </div>

                            <div>
                                <table style="text-align: right; width: 100%; height: 120px;">
                                    <tr>
                                        <td style="width: 100px;"><span style="font-size: 12px;">管理单位：</span></td>
                                        <td style="width:200px;">
                                             <asp:Panel runat="server" ID="Panel17">
                                    <dx:ASPxComboBox runat="server" ID="cobGLDW" Width="80%"  ClientInstanceName="cobGLDW" ValueType="System.String" EnableIncrementalFiltering="True"  DropDownStyle="DropDown">
                                    </dx:ASPxComboBox>
                                </asp:Panel> 
                                        </td>
                                        <td><span style="font-size: 12px;">回灌户：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGH" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGH"></dx:ASPxTextBox>
                                        </td>
                                        <td><span style="font-size: 12px;">回灌井：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGJ" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGJ"></dx:ASPxTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><span style="font-size: 12px;">年回灌能力：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGNL" ClientEnabled="false" Width="80%" ClientInstanceName="txtHGNL"></dx:ASPxTextBox>
                                        </td>
                                        <td style="width: 10%;"><span style="font-size: 12px;">现回灌能力：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtXHGNL" ClientEnabled="false" Width="80%" ClientInstanceName="txtXHGNL"></dx:ASPxTextBox>
                                        </td>
                                         <td><span style="font-size: 12px;">测试回灌能力：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtCHHGNL" ClientEnabled="true" Width="80%" ClientInstanceName="txtCHHGNL"></dx:ASPxTextBox>
                                        </td> 
                                    </tr>
                                    <tr>
                                        <td><span style="font-size: 12px;">回灌量：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGL" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGL"></dx:ASPxTextBox>
                                        </td>
                                          <td><span style="font-size: 12px;">回灌计划：</span></td>
                                        <td >
                                            <dx:ASPxTextBox runat="server" ID="txtHGJH" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGJH"></dx:ASPxTextBox>
                                        </td>
                                        <td><span style="font-size: 12px;">回灌单价：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtHGDW" ClientEnabled="true" Width="80%" ClientInstanceName="txtHGDW"></dx:ASPxTextBox>
                                        </td> 
                                       
                                    </tr>
                                    <tr>
                                          <td><span style="font-size: 12px;">未退回灌费：</span></td>
                                        <td >
                                            <dx:ASPxTextBox runat="server" ID="txtWTHGF" ClientEnabled="true" Width="80%" ClientInstanceName="txtWTHGF"></dx:ASPxTextBox>
                                        </td>
                                          <td style="width: 10%;"><span style="font-size: 12px;">已退回灌费：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtYTHGF2" ClientEnabled="true" Width="80%" ClientInstanceName="txtYTHGF2"></dx:ASPxTextBox>
                                        </td>  
                                        <td style="width: 10%;"><span style="font-size: 12px;">预退回灌费：</span></td>
                                        <td>
                                            <dx:ASPxTextBox runat="server" ID="txtYTHGF" ClientEnabled="true" Width="80%" ClientInstanceName="txtYTHGF"></dx:ASPxTextBox>
                                        </td> 
                                    </tr>
                                   
                                </table>
                            </div>
                            <div style="text-align: right;">

                                <hr />
                                <dx:ASPxButton ID="btnSave" runat="server" Text="保存"  UseSubmitBehavior="false" ClientInstanceName="btnSave" AutoPostBack="false"  Visible="false">
                                    <ClientSideEvents Click="function(s,e) {save(); }" />
                                </dx:ASPxButton>
                                <dx:ASPxButton ID="btnCancel" runat="server" Text="放弃" UseSubmitBehavior="false" >
                                    <ClientSideEvents  Click="function(s,e){display('init',-1);}"/>
                                </dx:ASPxButton>
                            </div>
                        </div>--%>
                    </div>

                </div>

            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
